﻿#region Using Directives

using System;

using Csla;

using MarketPulse.BusinessLogic.Core;
using MarketPulse.BusinessLogic.Common.Criteria;

#endregion

namespace MarketPulse.BusinessLogic.Private
{
    /// <summary>
    /// This class represents a read only collection of read only Assignment objects that are made by a mystery shopper or exit 
    /// interviewer (for eaxmple) when conducting either a mystery shop or exit interview or other 
    /// survey. 
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.AssignmentFactory, MarketPulse.DataAccess.Factory", "FetchList")]
    public class AssignmentList : MarketPulseListBase<AssignmentList, Assignment>
    {

        #region Constructors

            /// <summary>
            /// Default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private AssignmentList()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

                ///// <summary>
                ///// Method used to create a new collection of Assignments objects (via the DataPortal client proxy)
                ///// </summary>
                ///// <returns>The newly created collection of Assignment objects</returns>
                //public static AssignmentList New()
                //{
                //    return DataPortal.Create<AssignmentList>();
                //}

                /// <summary>
                /// Method used to get a list of Assignments that are associated with a particular Client (via the DataPortal client proxy)
                /// </summary>
                /// <param name="countryGuid">The Guid of the Country to retrieve the Assignments for </param>
                /// <returns>The valid list of Assignments (populated or empty)</returns>
                public static AssignmentList GetByCountryGuid(Guid countryGuid)
                {
                    return DataPortal.Fetch<AssignmentList>(new AssignmentSearchCriteria(null, countryGuid));
                }

            #endregion

        #endregion

    }
}
